import { createRouter, createWebHashHistory } from 'vue-router'
import LoginView from '@/views/LoginView/LoginView.vue'

const routes = [
    {
        path: '/',
        name: 'login',
        component: LoginView
    },
    {
        path: '/home',
        name: 'home',
        component: () => import(/* webpackChunkName: "home-group" */ '@/views/HomeView/HomeView.vue'),
        children: [
            {
                path: 'welcome',
                name: 'welcome',
                component: () => import(/* webpackChunkName: "home-group" */ '@/views/WelcomeView/WelcomeView.vue'),
            },
            {
                path: 'users',
                name: 'users',
                component: () => import(/* webpackChunkName: "home-group" */ '@/views/UserView/UserView.vue'),
            },
            {
                path: 'categories',
                name: 'categories',
                component: () => import(/* webpackChunkName: "home-group" */ '@/views/CategorieView/CategorieView.vue'),
            },
            {
                path: 'goods/add',
                name: 'goodsAdd',
                component: () => import(/* webpackChunkName: "home-group" */ '@/views/AddGoodView/AddGoodView.vue'),
            }
        ]
    }
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router
